package org.eclipse.football;

import static org.junit.Assert.*;

import org.junit.Test;

public class RemovePlayers {

	@Test
	public void test() {
		// Create a team
		Team team = new Team("team", "user");
		
		// Create an offensive player, a defensive player, and a kicker
		OffPlayer off_player = new OffPlayer("off_player", "team");
		DefPlayer def_player = new DefPlayer("def_player", "team");
		Kicker kicker = new Kicker("kicker", "team");
		
		// Add all 3 players to team
		team.addOffPlayer(off_player);
		team.addDefPlayer(def_player);
		team.addKicker(kicker);
		
		// Get number of offensive players
		int old_size = team.getOff_players().size();
		
		// Try to remove offensive player from team
		team.removeOffPlayer(off_player);
		
		// Make sure number of offensive players decreased by 1
		assertEquals(old_size - 1, team.getOff_players().size());
		
		// Get number of defensive players
		old_size = team.getDef_players().size();
		
		// Try to remove defensive player from team
		team.removeDefPlayer(def_player);
		
		// make sure number of defensive players decreased by 1
		assertEquals(old_size - 1, team.getDef_players().size());
		
		// Get number of kickers
		old_size = team.getKickers().size();
		
		// Try to remove kicker from team
		team.removeKicker(kicker);
		
		// Make sure number of kickers decreased by 1
		assertEquals(old_size - 1, team.getKickers().size());
	}

}
